package Java_promotion_136_228.Java206_228;

//获取流之后，可以使用映射的方法;map(用于转换的Lambda表达式)
//映射，就是将一个对象转换成另一个对象，吧旧对象映射到新对象

import java.util.ArrayList;
import java.util.stream.Stream;

public class _217 {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        list.add("100古力娜扎");
        list.add("200蒙娜丽莎");
        list.add("300迪丽热巴");

        Stream<Integer> streama = list.stream().map((String str) -> {
            int num = Integer.parseInt(str);
            return num;
        });
        Stream<Integer> streamb = list.stream().map(str -> {
            int num = Integer.parseInt(str);
            return num;
        });
        Stream<Integer> streamc = list.stream().map((String str) -> {
            return Integer.parseInt(str);
        });
        Stream<Integer> streamd = list.stream().map(Integer::parseInt);
        System.out.println("===================");
        ArrayList<String> list1 = new ArrayList<>();
        list1.add("120,古力娜扎");
        list1.add("100,古力娜扎");
        list1.add("10,古力娜扎");

        Stream<String> stream1 = list1.stream().map((String str) -> {
            String[] array = str.split(",");
            String result = array[1];
            return result;
        });

        Stream<String> stream2 = list1.stream().map(s -> {
            String[] array = s.split(",");
            String result = array[1];
            return result;
        });

        Stream<String> stream3 = list1.stream().map(s -> {
            String[] array = s.split(",");
            return array[1];
        });

        Stream<String> stream4 = list1.stream().map(s -> {
            return s.split(",")[1];
        });
        
        Stream<String> stream5 = list1.stream().map(s ->
                s.split(",")[1]
        );
    }
}
